﻿<UserControl 
    x:Class="DiscoveryLogic.Analytics.Modules.DedupRules.DedupRuleEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    Height="Auto" MinHeight="450" VerticalAlignment="Stretch" 
    HorizontalAlignment="Stretch" Width="Auto" MinWidth="650" 
    Loaded="UserControl_Loaded">
    <Border CornerRadius="10" BorderBrush="Gray" BorderThickness="2">
        <DockPanel LastChildFill="True">
            <Grid DockPanel.Dock="Top" Margin="15">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                
                <Label
                    Grid.Row="0" Grid.Column="0"
                    VerticalAlignment="Center" Margin="5,0,5,0">Rule name:</Label>
                <TextBox x:Name="txtRuleName"
                    Grid.Row="0" Grid.Column="1"
                    VerticalAlignment="Center" Margin="5,0,5,0">Rule name</TextBox>
                
                <Label 
                    Grid.Row="1" Grid.Column="0"
                    VerticalAlignment="Center" Margin="5,0,0,0">Entity type:</Label>
                <ComboBox x:Name="cboEntityType"
                    Grid.Row="1" Grid.Column="1"
                    VerticalAlignment="Center" Margin="5,0,5,0" SelectionChanged="cboEntityType_SelectionChanged"></ComboBox>
                
                
            </Grid>
            <StackPanel DockPanel.Dock="Bottom" Margin="5" Orientation="Vertical">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5">
                    <Label Width="120">Association threhold:</Label>
                    <Slider 
                        x:Name="sliderAssoc" Orientation="Horizontal" Minimum="0" 
                        Maximum="100" Value="0" Width="120" SmallChange="0.1" LargeChange="1"
                        VerticalAlignment="Center" ValueChanged="sliderAssoc_ValueChanged" /> 
                    <Label x:Name="lblAssocThrehold" Margin="5,0,0,0" VerticalAlignment="Center">0</Label>
                </StackPanel>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5">
                    <Label Width="120">Collapse threhold:</Label>
                    <Slider 
                        x:Name="sliderCollapse" Orientation="Horizontal" 
                        Minimum="0" Maximum="100" SmallChange="0.1" Value="0" LargeChange="1"
                        Width="120" VerticalAlignment="Center" ValueChanged="sliderCollapse_ValueChanged" />
                    <Label x:Name="lblCollapseThrehold" Margin="5,0,0,0" VerticalAlignment="Center">0</Label>
                </StackPanel>
                <StackPanel Margin="0,0,0,5" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                    <Button x:Name="btnCancel" Content="Cancel" VerticalAlignment="Center" Margin="5,0,5,0" Width="60" Click="btnCancel_Click" />
                    <Button x:Name="btnOK" Content="OK" VerticalAlignment="Center" Margin="5,0,5,0" Width="60" Click="btnOK_Click" />
                </StackPanel>
            </StackPanel>
            
            <WindowsFormsHost Margin="10">
                <Forms:DataGridView x:Name="dvFields" Dock="Fill">
                    <Forms:DataGridView.Columns>
                        <Forms:DataGridViewCheckBoxColumn Width="35" HeaderText="Include"/>
                        <Forms:DataGridViewTextBoxColumn Width="100" HeaderText="Field"/>
                        <Forms:DataGridViewCheckBoxColumn Width="35" HeaderText="Assoc?"/>
                        <Forms:DataGridViewTextBoxColumn Width="40" HeaderText="Weight"/>
                        <Forms:DataGridViewComboBoxColumn Width="150" HeaderText="Comparer"/>
                        <Forms:DataGridViewTextBoxColumn Width="40" HeaderText="Penalty"/>
                    </Forms:DataGridView.Columns>
                </Forms:DataGridView>
            </WindowsFormsHost>
        </DockPanel>
        
    </Border>
</UserControl>
